package com.tyq.lianxi_1;

import java.util.ArrayList;
import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		ListView lv = (ListView) findViewById(R.id.main_listView1);
		//String[] datas = {"aa","bb","cc","dd","aa","bb","cc","dd","aa","bb","cc","dd","aa","bb","cc","dd","aa","bb","cc","dd"};
		List<String> datas =new ArrayList<String>();
		datas.add("aa");datas.add("bb");datas.add("cc");datas.add("dd");datas.add("ee");
		datas.add("aa");datas.add("bb");datas.add("cc");datas.add("dd");datas.add("ee");
		datas.add("aa");datas.add("bb");datas.add("cc");datas.add("dd");datas.add("ee");
		ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, datas);
		lv.setAdapter(adapter);
	}
	public void simple(View v){
		Intent it = new Intent(this, Simple_Activity.class);
		startActivity(it);
	}
}
